<template>
	<view style="padding-top: 10rpx;">
		<view v-for="(item,index) in editList" @click="routerFn(item)" :key="index" class="modelBox flex_b" style="border-radius: 10rpx;">
			<view class="">{{item.title}}</view>
			<view class="iconfont icon-xiangyoujiantou" style="font-size: 24rpx;"></view>
		</view>
		
		<view class="quitLogin" @click="quitLoginFn">
			<view class="f-t">退出登录</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				editList:[
					{
						title:'账户安全',
						router:'/otherpages/edit/accounts'
					},
					{
						title:'隐私设置',
						router:'/otherpages/edit/privacyEdit'
					},
					{
						title:'用户反馈',
						router:'/otherpages/edit/feedback'
					},
					{
						title:'用户协议',
						router:'/otherpages/protocol/protocol'
					},
					{
						title:'隐私条款',
						router:'/otherpages/protocol/protocol'
					}
				]
			};
		},
		methods:{
			routerFn(item) {
				if(item.title=='用户协议'||item.title=='隐私条款') {
					this.$util.redirectTo(item.router,{type:item.title})
				}else{
					this.$util.redirectTo(item.router)
				}
			},
			quitLoginFn() {
				uni.showModal({
					title: '提示',
					content: '是否要退出登录？',
					success: res => {
						if (res.confirm) {
							uni.removeStorage({
								key: 'token',
								success: res => {
									this.token = ''
									this.$forceUpdate()
									uni.redirectTo({
										url:'/pages/login/login'
									})
								}
							});
						} else if (res.cancel) {
				
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.quitLogin {
		position: fixed;
		bottom: 0;
		background-color: #fff;
		padding-bottom: env(safe-area-inset-bottom);
		width: 750rpx;
		height: 88rpx;
		text-align: center;
		view {
			line-height: 88rpx;
		}
	}
</style>
